package com.gooluke.policy;

import com.gooluke.MyRejectHandler;
import com.gooluke.MyThreadPool;

/**
 * @author gooluke
 * description 队列满时，直接抛出异常
 * datetime 2025-04-07 22:12
 */
public class MyAbortPolicy implements MyRejectHandler {
    @Override
    public void reject(Runnable runnable, MyThreadPool threadPool) {
        throw new RuntimeException("Task " + runnable.toString() + " rejected from " + threadPool.toString());
    }
}
